package quickup;

import java.io.File;
import java.io.FileFilter;

public class AbstractFileFilter implements FileFilter {

	String[] acceptable = {"jpeg","jpg","png","gif","pdf","psd","bmp"};
	
	public AbstractFileFilter() {}
	
	public AbstractFileFilter(String[] accepts) {
		acceptable = accepts;
	}
	
	public boolean accept(File file) {
		if(file.isDirectory()) return true;
		for(int i = 0; i < acceptable.length; i++)
			if(file.getName().toLowerCase().endsWith(acceptable[i])) return true;
		return false;
	}

}
